function btnAdd() {
    console.log('新增');
    location.href = '/blogs/' + 0
}
function btnEdit(id) {
    console.log('编辑');
    location.href = '/blogs/' + id
}
function btnDel(id) {
    // console.log('删除');
    let url = '/blogs/' + id
    let isConfirm = confirm('确认删除吗？')
    if (isConfirm) {
        axios.delete(url).then(res => {
            if (res.status === 200) {
                let tr = document.querySelector(`.blogs${id}`)
                tr.remove()
            }
        })
        // console.log('删除成功');

    } else {
        console.log('取消删除');

    }
}

function btnFilter(){
    // console.log('我是查询');
    // 获取keywork
    let keyword = document.querySelector('input[name=keyword]').value
    // console.log(keyword);

    location.href = `/blogs?keyword=${keyword}`
}